﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameCore;
using GameObject;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace ResourceManager
{
    public class ActionBoardManager : EntityManager
    {
        public override void InitPrototype()
        {
            string[] strsource = ResourceDefine.ActionBoard_stresource;// { "board_normal", "board_hover", };

            _nprototype = ResourceDefine.ActionBoard_textdefine.Count<string>();
            _prototype = new ActionBoard[_nprototype];

            Point size = ResourceDefine.Action_size;

            for (int i = 0; i < _nprototype; i++)
            {
                _prototype[i] = new ActionBoard(size);
                ((ActionBoard)_prototype[i]).Init(1, strsource, ResourceDefine.ActionBoard_textdefine[i], GlobalDefine.Content.Load<SpriteFont>(@"Font\Arial"));
            }

            
        }

        public override VisibleGameObject CreateObject(int index)
        {
            if ((index < 0) || (index >= _nprototype))
            {
                return null;
            }
            return _prototype[index].Clone();
        }
    }
}
